Edge Sensitive Bayer Demosaicing Algorithm

简要说明

文件: \examples\Processing\Color\Bayer\LaplaceFilter_maVCL.va

默认平台: mE5-MA-VCL

简短说明

Laplace Edge Sensitive Bayer Demosaicing

在本节中,我们将介绍一个边缘敏感的 Bayer 去马赛克算法示例,称之为 “Laplace 滤波器”。接下来,我们将首先描述插值算法,随后简要介绍其在 VisualApplets 中的实现。

Interpolation Algorithm

对于红像素和蓝像素上绿色值的插值,使用了垂直和水平方向的梯度( 和 ):

公式 2。


是需要内插绿色值的像素上的 色度值(红色或蓝色)。 绿色 随后 位于红色和蓝色像素位置上:

公式 3。


这里的值 决定了边缘的重要程度。 对于红色和蓝色颜色的插值,存在三种情况:

1. 颜色插值 在同色行的绿色像素上:

公式 4。


2. 颜色插值 在异色行的绿色像素上:

公式 5。


3. 对于异色像素上的颜色插值,使用梯度 和 :

公式 6。


则该颜色(红色或蓝色)为:

公式 7。


在 VisualApplets 中的实现

您可以在 \examples\Processing\Color\Bayer\LaplaceFilter_maVCL.va 下找到用于 Laplace filter" 的 VisualApplets 设计。在图 242 中,您可以看到基本设计结构。InputImage 和 OutputImage 的内容与基本采集示例等同(参见例如 'Basic Acquisition Examples for Camera Link Cameras for marathon Frame Grabbers')。

基本设计结构

图 242. 基本设计结构


在 图 243,“HierarchicalBox Laplace 的内容”中显示了 HierarchicalBox Laplace 的内容。

HierarchicalBox Laplace 的内容

图 243. HierarchicalBox Laplace 的内容


在 HierarchicalBox HorizontalValues, VerticalValues, Green_On_Color_Pixel 和 Color_On_Other_Color 中, 核的单个核组件用于计算 公式 2 设为 公式 7的单个方程步骤。 注释框详细介绍了每个 HierarchiaclBox 的内容以及当前的方程步骤。

在 图 244,“HierarchicalBox SortToComponents 的内容”中,您可以看到框 SortToComponents 的内容。在此处,计算出的红、绿、蓝彩色值会根据当前像素的颜色分配给输出值。 当前像素的颜色由 HierarchicalBox WhereAmI_Colour 确定。您可以在此处选择不同的 Bayer 模式, 正如示例中相应的注释框中所解释的那样。

HierarchicalBox SortToComponents 的内容

图 244. HierarchicalBox SortToComponents 的内容